<script setup lang="ts">
// 接收父组件的数据
const props = defineProps<{
  tableHeadData: any
  tableBodyData: any
}>()
</script>
<template>
  <div class="human-tab">
    <ul>
      <li v-for="(item, index) in props.tableHeadData" :key="item">
        {{ item }}
      </li>
    </ul>
    <ul>
      <li v-for="(row, index) in props.tableBodyData" :key="row" :title="row">
        {{ row.split(',').join('、') }}
      </li>
    </ul>
  </div>
</template>

<style lang="scss" scoped>
.human-tab {
  width: 100%;
  height: 260px;
  display: flex;
  justify-content: center;
  align-items: center;
  ul {
    background-color: rgba(0, 48, 78, 0.5);
    height: 240px;
    border-right: 2px solid rgba(0, 0, 0, 0);
    font-size: 12px;
  }
  ul:first-of-type {
    width: 20%;
  }
  ul:last-child {
    width: 75%;
    color: #00EDFF;
  }
  li {
    width: 100%;
    background-color: rgba(0, 48, 78, 0.5);
    height: calc((240px - 10px) / 5);
    margin-bottom: 3px;
    text-align: center;
    line-height: 46px;
    white-space: nowrap; /* 不允许文本换行 */
    overflow: hidden; /* 超出部分隐藏 */
    text-overflow: ellipsis; /* 超出部分省略为省略号 */
    &:last-child {
      border-bottom: none;
    }
  }
}
</style>
